﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using TYLitedbBase;

namespace DSPara
{
    public class Entity_SortPara : TYLitedbBase.Entity_LiteDB_Base
    {
        public Entity_SortPara()
        {
        }

        public string SectionId { get; set; }

        public string TypeName { get; set; }

        public bool IsDefault { get; set; }

        public List<Entity_SortPara_Level> ListSortPara { get; set; } = new List<Entity_SortPara_Level>();

        public override string ToString()
        {
            StringBuilder str = new StringBuilder();
            str.Append($"name :{TypeName}\r\n");
            if (ListSortPara != null)
            {
                for (int i = 0; i < ListSortPara.Count; i++)
                {
                    //str.Append($"# {ListSortPara[i].AtLevel}\t ocv :{ListSortPara[i].OCV_Min}~{ListSortPara[i].OCV_Max}\t ir :{ListSortPara[i].IR_Min}~{ListSortPara[i].IR_Max}\r\n");
                }
            }
            return str.ToString();
        }
    }

    public class Entity_SortPara_Level : Entity_LiteDB_Base
    {
        /// <summary>
        /// 这个从1开始
        /// </summary>
        public int AtLevel { get; set; }

        public List<Entity_SortItem> ListSortItem { get; set; } = new List<Entity_SortItem>();
    }

    public class Entity_SortItem : Entity_LiteDB_Base
    {
        public double Max { get; set; }
        public double Min { get; set; }
        public bool IsUse { get; set; }
    }
}